﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="dodajlek.aspx.cs" Inherits="STS.Pacjent.dodajlek" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Label ID="id_pacjenta" runat="server" Text="Label" Visible="False"></asp:Label>
    <asp:Label ID="tekst" runat="server" Text="Label" Visible="False"></asp:Label>
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:MGRConnectionString %>" 
    DeleteCommand="DELETE FROM [lek] WHERE [id_leku] = @id_leku" 
    InsertCommand="INSERT INTO [lek] ([nazwa], [url], [opis]) VALUES (@nazwa, @url, @opis)" 
    SelectCommand="SELECT * FROM [lek]" 
    UpdateCommand="UPDATE [lek] SET [nazwa] = @nazwa, [url] = @url, [opis] = @opis WHERE [id_leku] = @id_leku">
    <DeleteParameters>
        <asp:Parameter Name="id_leku" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="nazwa" Type="String" />
        <asp:Parameter Name="url" Type="String" />
        <asp:Parameter Name="opis" Type="String" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="nazwa" Type="String" />
        <asp:Parameter Name="url" Type="String" />
        <asp:Parameter Name="opis" Type="String" />
        <asp:Parameter Name="id_leku" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
    DataKeyNames="id_leku" DataSourceID="SqlDataSource1" DefaultMode="Insert" 
    Height="50px" Width="125px">
    <Fields>
        <asp:BoundField DataField="id_leku" HeaderText="id_leku" InsertVisible="False" 
            ReadOnly="True" SortExpression="id_leku" />
        <asp:BoundField DataField="nazwa" HeaderText="nazwa" SortExpression="nazwa" />
        <asp:BoundField DataField="url" HeaderText="url" SortExpression="url" />
        <asp:BoundField DataField="opis" HeaderText="opis" SortExpression="opis" />
        <asp:CommandField ButtonType="Button" ShowInsertButton="True" />
    </Fields>
</asp:DetailsView>
</asp:Content>
